﻿using System.Collections.Generic;
using CNF.Common.Base.SimpleOrm.Entities;

namespace CNF.Common.Base.SimpleOrm.Data
{
    public interface IDataService<DataKeyType, EntityType> : IViewDataService<DataKeyType, EntityType>
        where DataKeyType : struct
        where EntityType : BaseEnity<DataKeyType>, new()
    {
        void Insert(EntityType entity);
        void Update(EntityType entity);
        //int Update(string updateSql, params object[] args);
        //int Update(Sql updateSql);
        int Update(EntityType entity, IEnumerable<string> columns);
        //int Delete(string deleteCondition, params object[] args);
        //int Delete(Sql deleteSql);
        void Save(EntityType poco);
        void DeleteById(DataKeyType dataKey);
        void Delete(EntityType entity);
        //int Execute(string sql, params object[] args);
        //int Execute(Sql sql);
        int PartUpdate(object partUpdateObject, DataKeyType dataKey);
        int PartInsert(object partInsertObject);
    }
}
